#include <BaseSubsystem.h>
#include <Poco/NotificationCenter.h>
#include <Poco/NObserver.h>
BaseSubsystem::BaseSubsystem(void)
{
}

BaseSubsystem::~BaseSubsystem(void)
{
}


void BaseSubsystem::initialize(Poco::Util::Application& app)
{
	Poco::NotificationCenter::defaultCenter().addObserver(Poco::NObserver<BaseSubsystem , ApplicationStartingNotification>(*this , &BaseSubsystem::handleApplicationStart ) );
}

void BaseSubsystem::uninitialize()
{
	Poco::NotificationCenter::defaultCenter().removeObserver(Poco::NObserver<BaseSubsystem , ApplicationStartingNotification>(*this , &BaseSubsystem::handleApplicationStart ) );
	OnStop();
}

void BaseSubsystem::handleApplicationStart(const Poco::AutoPtr<ApplicationStartingNotification>& aNotification)
{
	OnStart(aNotification->iApp);
}